-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Acknowledge packets asynchronously #1392
Acknowledge packets asynchronously #1392
Conversation
cc @rnbguy |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1392 +/- ##
==========================================
- Coverage 67.09% 67.07% -0.03%
==========================================
Files 226 226
Lines 22425 22485 +60
==========================================
+ Hits 15047 15082 +35
- Misses 7378 7403 +25 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @sug0, thanks for upstreaming the changes! I’ve requested a few updates. In addition to those, it would be great if you could:
- select "Allow edits from maintainers" so we can move quickly on fixing minor findings
- Update the README under ibc-core: https://github.com/cosmos/ibc-rs/tree/main/ibc-core#asynchronous-acknowledgements
- Update your branch once add optional arbitrary impls #1390 merged.
4. (If there is) share a pointer to your codebase where this changes has been integrated to better understand your use case.
b388e85
to
2bfea0b
Compare
2bfea0b
to
6c30f13
Compare
6c30f13
to
f6b68fe
Compare
f6b68fe
to
2adeb6b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything's set! Thanks so much!
@@ -0,0 +1,2 @@ | |||
- Support asynchronous packet acknowledgements. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Support asynchronous packet acknowledgements. | |
- [ibc-core] Support asynchronous packet acknowledgements. |
/// ICS-26 `onRecvPacket` callback implementation. | ||
/// | ||
/// # Note on optional acknowledgements | ||
/// | ||
/// Acknowledgements can be committed asynchronously, hence | ||
/// the `Option` type. In general, acknowledgements should | ||
/// be committed to storage, accompanied by an ack event, | ||
/// as soon as a packet is received. This will be done | ||
/// automatically as long as `Some(ack)` is returned from | ||
/// this callback. However, in some cases, such as when | ||
/// implementing a multiple hop packet delivery protocol, | ||
/// a packet can only be acknowledged after it has reached | ||
/// the last hop. | ||
/// | ||
/// ## Committing a packet asynchronously | ||
/// | ||
/// Event emission and state updates for packet acknowledgements | ||
/// can be performed asynchronously using [`emit_packet_acknowledgement_event`] | ||
/// and [`commit_packet_acknowledgment`], respectively. | ||
/// | ||
/// [`commit_packet_acknowledgment`]: ../../channel/handler/fn.commit_packet_acknowledgment.html | ||
/// [`emit_packet_acknowledgement_event`]: ../../channel/handler/fn.emit_packet_acknowledgement_event.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great! Much appreciated!
Potentially related to #361
Description
This PR introduces the ability to acknowledge IBC packets asynchronously, bringing
ibc-rs
's API closer toibc-go
.These changes were required in order to implement the packet forward middleware on top of
ibc-rs
.PR author checklist:
unclog
.docs/
).Reviewer checklist:
Files changed
in the GitHub PR explorer.